#pragma once

using std::string;
using std::ifstream;
using std::set;

class PatternSolver
{
private:
	static const int pattern_size = 20979;

	//static int p2i[540000];
	static int i2p[30000];

	static set<int> always_win_pattern;
	static set<int> always_lose_pattern;
	
	static double gamma_pos[13];
	static double gamma_neg[13];
	static double gamma_pattern[540000];

	

public:
	static void load_from_dir(const string & dir_path);

	static double get_strength(int pattern, int neg, int pos);

	static int retrieve_pattern(const Board & board, int x, int y, int turn, int size);

	static int retrieve_pos(int x, int y, int turn, int size);

	static int retrieve_neg(int x, int y, int turn, int size);

	static void board_strength(const Board & board, double out[200], int size, int turn);

	static double pos_strength(const Board & board, int x, int y, int size, int turn);
};

//const int PatternSolver::pattern_size = 20979;

//int PatternSolver::p2i[530000] = { 0 };
